<!--
 * @Author: 朱自强
 * @Date: 2023-04-20 11:58:35
 * @LastEditors: 朱自强
 * @LastEditTime: 2024-03-12 19:46:50
 * @FilePath: \A-LOT-OF-TEST-VUE3\src\components\Aggrid\AgNoRows\AgNoRows.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by 朱自强, All Rights Reserved. 
-->
<template>
  <div :id="`ag-render-div-${uuid}`">
    <!-- 普通无数据 -->
    <div v-if="params.type === 'normalNoRows'">暂无数据</div>
  </div>
</template>

<script lang="ts" setup>
import type { Ref } from 'vue'
import type { INoRowsOverlayParams } from 'ag-grid-community'
import { onMounted, watch, ref } from 'vue'
import { getUUID } from '@/utils/utils'
// 唯一标识
const uuid: string = getUUID()
// 表格参数
const currParams: Ref<INoRowsOverlayParams | any> = ref(null)
// 属性
const props = defineProps({
  // ag默认参数
  params: {
    type: Object,
    default: null
  }
})
// 监听params
watch(
  () => props.params,
  (newVal: any) => {
    // console.log('ag自定义无数据', newVal);
    currParams.value = newVal
  },
  { immediate: true }
)
onMounted(() => {})
// 向外部暴露方法
defineExpose({})
</script>

<style lang="less" scoped></style>
